# !/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
@作者 杨阳
@时间 2018-07-10
@说明 junit测试类，利用unittest框架
@注意事项
"""
import logging
import unittest

from __init__ import create_app
from settings import SQLALCHEMY_DATABASE_URI
from util import LogUtil

app = create_app(__name__)


class junit(unittest.TestCase):

    def setUp(self):
        app.config['TESTING'] = True
        app.config['DEBUG'] = True
        app.config['WTF_CSRF_ENABLED'] = False
        app.config['SQLALCHEMY_DATABASE_URI'] = SQLALCHEMY_DATABASE_URI
        self.app = app.test_client()
        LogUtil.info("junit setUp.....")

    def tearDown(self):
        LogUtil.info("junit tearDown.....")

    def test(self):
        print("这里走了吗、")
        logging.basicConfig(format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s',
                            level=logging.DEBUG)
        logging.debug("junit test_get_user.....")


if __name__ == '__main__':
    unittest.main()
